﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Ruandao.MiniFace;

namespace WebSite.Controllers
{
    public class HomeController : Controller
    {
        public PageResult Index()
        {
            ViewBag.TestValue = "欢迎使用软道模板系统!";
            TestData();
            return this.TemplatePage("/Templates/Default/", "Page/test.htm");
        }

        private void TestData()
        {
            var dict = new Dictionary<string, Dictionary<string, Dictionary<string, string>>>();
            for (int i = 0; i < 3; i++)
            {
                var two = new Dictionary<string, Dictionary<string, string>>();
                for (int j = 0; j < 3; j++)
                {
                    var three = new Dictionary<string, string>();
                    for (int k = 0; k < 3; k++)
                    {
                        string key3 = "CCCCC" + i.ToString() + j.ToString() + k.ToString();
                        three.Add(key3, key3 + ":  aaa,bbb, ccc, ....");
                    }
                    string key2 = "BBBBB" + i.ToString() + j.ToString();
                    two.Add(key2, three);
                }
                dict.Add("AAAAA" + i.ToString(), two);
            }

            ViewBag.DictTree = dict;
        }

        public PageResult Content()
        {
            ViewBag.TestValue = "欢迎使用软道模板系统!";
            TestData();
            return this.TemplatePage("/Templates/Default/", "Page/Content.htm");
        }

        public PageResult Include()
        {
            return this.TemplatePage("/Templates/Default/", "Page/include.htm");
        }
    }
}
